<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="x-ua-compatible" content="ie=7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>类型信息管理</title>
<link href="/webvote/pages/style/main.css" rel="stylesheet" type="text/css" />
<link  rel ="stylesheet"  type ="text/css"  href ="/webvote/pages/ext/resources/css/ext-all.css" /> 
<script  type ="text/javascript"  src ="/webvote/pages/ext/adapter/ext/ext-base.js" ></script> 
<script  type ="text/javascript"  src ="/webvote/pages/ext/ext-all.js" ></script> 
<script type="text/javascript" src="/webvote/pages/js/type.js"></script>
<script type="text/javascript" src="/webvote/pages/js/jquery-1.3.1.js"></script>
<script>
var  highlightcolor='#c1ebff';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function addtypeUI(){
  window.location.href="/webvote/atype.do?action=addtypeUI";
}
</script>
</head>

<body style="background:url(/webvote/pages/images/index-1_15.gif) repeat-x #f3f3f3;">
<div class="c-top f14"><img src="/webvote/pages/images/download2 r.gif" />
<p>您当前所在的位置：<span>区域类型</span>>><span>类型信息管理</span></p></div>
<div class="main" style="margin-top:10px;">
<div class="biaoge" style="height:100%;overflow:auto;">
<form  name="typeForm" action="/webvote/atype.do?action=managetypeUI" method="post">
        <table width="100%" border="1" cellspacing="0" cellpadding="0" align="center" class="table1" onmouseover="changeto()"  onmouseout="changeback()">
				<tr>
					<td width="10%" height="30"  class="rd6">
						<input class="fuxuan" name="checkbox" type="checkbox" onclick="checkAll(this)" />全选
					</td>
					<td width="10%"  class="rd6">
						序号
					</td>
					<td width="40%"  class="rd6">
						类型名称
					</td>
					<td width="40%"  class="rd6">
						操&nbsp;&nbsp;&nbsp;&nbsp;作
					</td>
				</tr>
				<!-- 内容输出 -->
                <c:forEach var="type" items="${page.data}">
				<tr>
					<td class="rd8">
						<input class="fuxuan" type="checkbox" name="selectFlag" id="${type.tiId}" />
					</td>
					<td class="rd8">
						${type.tiId}
					</td>
					<td class="rd8">
						${type.tiName }
					</td>
					<td class="rd8"> 
					   <div align="center">
                        <div id="${type.tiId}_c" >
   							<label onclick="clickOpen('${type.tiId}_c','${type.tiId}_d')" style="cursor: hand;">
   								<img src="/webvote/pages/images/edit.gif" />
   							</label>
   						</div>
   					<div id="${type.tiId}_d" style="display: none;">
   						<a href="/webvote/atype.do?action=updatetypeUI&tiid=${type.tiId}">修改</a>
   						/
   						<a href="javascript:clickExist('${type.tiId}_c','${type.tiId}_d')">取消</a>
   					</div>
                    </div>
					</td>
				</tr>
				</c:forEach>
			</table>
			<table width="100%" height="30" border="0" align="center" cellpadding="0" cellspacing="0" class="tb1">
          <tr>
					<td nowrap class="rd19" height="2">
						<div align="left" style="margin-left:20px;">
							<input name="btnTopPage" class="button1" type="button"
								id="btnTopPage" value="首页" title="首页"
								onClick="first()"/>
							<input name="btnPreviousPage" class="button1" type="button"
								id="btnPreviousPage" value="上一页" title="上页"
								onClick="before()"/>
							<input name="btnNextPage" class="button1" type="button"
								id="btnNextPage" value="下一页" title="下页" onClick="next()"/>
							<input name="btnBottomPage" class="button1" type="button"
								id="btnBottomPage" value="尾页" title="尾页"
								onClick="last()"/>
							<input name="btnAdd" type="button" class="button1" id="btnAdd"
								value="添加" onClick="addtypeUI()" />
							<input name="btnDelete" class="button1" type="button"
								id="btnDelete" value="删除" onClick="deleteTypeInfo()"/>
						</div>
					</td>
					<td nowrap class="rd19">
						<div align="right" style="margin-right:20px;">
                             <font class="STYLE1">&nbsp;共${page.totalPages}页</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<font class="STYLE1">当前第</font>
							<font class="STYLE1" >${page.pageNo}</font>
							<font class="STYLE1">页</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <span class="STYLE1">转到第<input  id="page.pageNo" name="page.pageNo" type="text" size="4" class="input1" value="${page.pageNo}"/> 页 </span>
                            <input name="btnBottomPage" class="button4" type="button" value="确定" onclick="formsubmit()" />

						</div>
					</td>
				</tr>
		</table>
		
		<script type="text/javascript">
    	//表单提交
    	function formsubmit(){
    		document.getElementById('typeForm').submit();
    	}
		
		//点击首页
   		function first(){
   			document.getElementById('page.pageNo').value=1;
   			formsubmit();
   		}
   		
   		//点击上一页
   		function before(){
   			if(parseInt(document.getElementById('page.pageNo').value)>1){
	   			document.getElementById('page.pageNo').value=parseInt(document.getElementById('page.pageNo').value)-1;
	   			formsubmit();
   			}
   		}
   				
   		//点击下一页
   		function next(){
   			if(parseInt(document.getElementById('page.pageNo').value)<${page.totalPages }){
				document.getElementById('page.pageNo').value=parseInt(document.getElementById('page.pageNo').value)+1;
				formsubmit();
			}
   		}
   				
   		//点击最后一页
   		function last(){
   			document.getElementById('page.pageNo').value=${page.totalPages };
   			formsubmit();
   		}
    </script>
</form>
</div>
</div>
</body>
</html>

